home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / WSKERR.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  67 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.11  $
  6. //
  7. // Winsock for OWL subsystem.
  8. // Based on work by Paul Pedriana, 70541.3223@compuserve.com
  9. //----------------------------------------------------------------------------
  10. #if !defined(OWL_WSKERR_H)
  11. #define OWL_WSKERR_H
  12.  
  13. #if !defined(OWL_DEFS_H)
  14. # include <owl/defs.h>
  15. #endif
  16.  
  17. #if defined(BI_NAMESPACE)
  18. namespace OWL {
  19. #endif
  20.  
  21. // Generic definitions/compiler options (eg. alignment) preceeding the 
  22. // definition of classes
  23. #include <services/preclass.h>
  24.  
  25. //
  26. // class TSocketError
  27. // ~~~~~ ~~~~~~~~~~~~
  28. // Converts Winsock errors to string messages.
  29. //
  30. class _OWLCLASS TSocketError {
  31.   public:
  32.     TSocketError(int error = 0, int sizeToAllocate = 128);
  33.     virtual ~TSocketError();
  34.  
  35.     TSocketError& operator =(const TSocketError& src);
  36.     friend bool operator ==(const TSocketError& socketError1,
  37.                             const TSocketError& socketError2);
  38.  
  39.     void  Init(int error);
  40.     int   GetReasonValue() const;
  41.     const char* GetReasonString() const;
  42.  
  43.     // Default to our own string (NULL argument).
  44.     char* AppendError(char* stringToAppendErrorTo, char* destination = 0);
  45.     char* AppendError(int stringResourceToAppendErrorTo, char* destination = 0);
  46.  
  47.   protected:
  48.     int   Error;            // Error code
  49.     int   SizeToAllocate;   // Size to allocate for String.
  50.                             // Usually bigger than String so we can append to it.
  51.     char* String;           // Error code converted to string
  52.     void  GetErrorString(); // Convert the error code to string
  53.  
  54.   private:
  55.     static TModule& GetModule();    // used for LoadString()
  56. };
  57.  
  58. // Generic definitions/compiler options (eg. alignment) following the 
  59. // definition of classes
  60. #include <services/posclass.h>
  61.  
  62. #if defined(BI_NAMESPACE)
  63. } // namespace OWL
  64. #endif
  65.  
  66. #endif  // OWL_WSKERR_H
  67.